package com.example.demo.controller;


import com.example.demo.common.result.Result;
import com.example.demo.service.requestRvo.IDRvo;

import com.example.demo.service.requestRvo.QueryListRVO;
import com.example.demo.service.impl.UserImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/example")
public class helloController {
    @GetMapping
    public String hello() {
        return "hello";
    }

    @Autowired
    UserImpl userImpl;


    @PostMapping("/getlistById")
    public Result getlistById(@Validated @RequestBody IDRvo vo){
        return userImpl.getLIstById(vo);
    }

    @PostMapping("/list")
    public Result getList(@Validated @RequestBody QueryListRVO vo){
        return userImpl.getList(vo);
    }
    @PostMapping("/listAll")
    public Result getListAll(@Validated @RequestBody QueryListRVO vo){
        return userImpl.getListAll(vo);
    }
}
